package com.dnui.seven2.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dnui.seven2.entity.Merch;
import com.dnui.seven2.entity.Shows;
import com.dnui.seven2.service.ShowsService;
import com.dnui.seven2.mapper.ShowsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author fengy
 * @description 针对表【shows】的数据库操作Service实现
 * @createDate 2022-10-16 09:11:47
 */
@Service
public class ShowsServiceImpl extends ServiceImpl<ShowsMapper, Shows>
        implements ShowsService{

    @Autowired
    private ShowsMapper showsMapper;

    @Override
    public List<Shows> queryShows(Integer currentPageNum, Integer everyPage) {
        Page page=new Page(currentPageNum,everyPage);
        showsMapper.selectPage(page, null);
        return page.getRecords();
    }



    @Override
    public void deleteShow(Long showId) {
        showsMapper.deleteById(showId);
    }

    @Override
    public void updateShow(Shows shows) {
        showsMapper.updateById(shows);
    }

    @Override
    public List<Shows> selectAll() {
        //构造条件构造器
        LambdaQueryWrapper<Shows> queryWrapper=new LambdaQueryWrapper();
        List<Shows> shows = showsMapper.selectList(null);
        return shows;
    }
}




